home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Data 2002 May / CD Rom Data Mayıs 2002.iso / Freeware / Blitz Basic / data1.cab / Support / help / beginners / tutorial / deepend / 2 - complex example uncommented.bb < prev    next >
Encoding:
Text File  |  2002-04-10  |  866 b   |  39 lines

  1.  
  2. ; ---------------------------------------------------------------------
  3. ; Complex example of double-buffered animation - support@blitzbasic.com
  4. ; ---------------------------------------------------------------------
  5. ; Uncommented version, to show how simple the code really is...
  6.  
  7. Graphics 640, 480
  8. SetBuffer BackBuffer ()
  9.  
  10. background = LoadImage ("george.bmp")
  11.  
  12. player = LoadImage ("rocket.bmp")
  13. MaskImage player, 255, 0, 255
  14.  
  15. foreground = LoadImage ("xmas.bmp")
  16. MaskImage foreground, 255, 0, 255
  17.  
  18. x = 320
  19. y = 340
  20.  
  21. Repeat
  22.  
  23.     Cls
  24.     
  25.     If KeyDown (203) Then x = x - 1 ; Left cursor
  26.     If KeyDown (205) Then x = x + 1 ; Right cursor
  27.     If KeyDown (200) Then y = y - 1 ; Up cursor
  28.     If KeyDown (208) Then y = y + 1 ; Down cursor
  29.  
  30.     TileImage background
  31.     DrawImage player, x, y
  32.     DrawImage foreground, 0, 250
  33.     
  34.     Flip
  35.     
  36. Until KeyHit (1)
  37.  
  38. End
  39.